package blazingbubble.game.command.net;

import blazingbubble.command.NetworkCommand;
import blazingbubble.game.command.CannonRotateStartCommand;
import spark.network.Sender;
import spark.network.NetworkConnection;
import moltencore.network.protocol.CannonRotateStart;
import moltencore.game.Cannon;

public class NetCannonRotateStartCommand extends CannonRotateStartCommand {
	private NetworkCommand networkCommand;

	void startupNetworkingAbility(Sender sender, NetworkConnection serverConnection) {
		networkCommand = new NetworkCommand(sender, serverConnection);
	}

	@Override
	public void rotate(Cannon.Direction direction) {
		CannonRotateStart packet = new CannonRotateStart();
		packet.setDirection(direction);
		networkCommand.send(packet);
	}
}